package com.example.goodrubish.Garbage;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.example.goodrubish.R;

import java.util.List;

public class History_adapter extends ArrayAdapter {
    private int resourceId;

    public History_adapter(Context context, int textViewResourceId, List<String> objects){
        super(context,textViewResourceId,objects);
        resourceId=textViewResourceId;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent){
        String news_list= (String) getItem(position);
        View view= LayoutInflater.from(getContext()).inflate(resourceId, parent,false);
        TextView garbageTitle=(TextView)view.findViewById(R.id.history_name);
        garbageTitle.setText(news_list);
        return view;
    }
}
